﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Iesi.Collections.Generic;
using System.Collections.ObjectModel;

namespace VisualAgile.Model
{
    [Serializable]
    public class Task  
    {
        /// <summary>
        /// Created Date
        /// </summary>
        public virtual DateTime CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// Created by
        /// </summary>
        public virtual System.String Creator
        {
            get;
            set;
        }

        /// <summary>
        /// Task ID
        /// </summary>
        public virtual Guid TaskID
        {
            get;
            set;
        }

        /// <summary>
        /// Actuals ID
        /// </summary>
        public virtual Story Story
        {
            get;
            set;
        }

        /// <summary>
        /// Task Status
        /// </summary>
        public virtual Status Status
        {
            get;
            set;
        }

        /// <summary>
        /// Iteration ID
        /// </summary>
        public virtual System.String IterationID
        {
            get;
            set;
        }       

        /// <summary>
        /// Task name
        /// </summary>
        public virtual System.String Name
        {
            get;
            set;
        }

        /// <summary>
        /// color
        /// </summary>
        public virtual System.String Color
        {
            get;
            set;
        }

        /// <summary>
        /// Task size
        /// </summary>
        public virtual System.Double Remaining
        {
            get;
            set;
        }

        /// <summary>
        /// Task size
        /// </summary>
        public virtual System.Double Evaluation
        {
            get;
            set;
        }

        /// <summary>
        /// Task size
        /// </summary>
        public virtual System.Double Beyond
        {
            get;
            set;
        }

        /// <summary>
        /// Is initial task
        /// </summary>
        public virtual System.Boolean Primary
        {
            get;
            set;
        }
       

        /// <summary>
        /// assigned to 
        /// </summary>
        public virtual User Consignee
        {
            get;
            set;
        }

        /// <summary>
        /// Create date
        /// </summary>
        public virtual System.DateTime? CreateDate
        {
            get;
            set;
        }

        /// <summary>
        /// Create date
        /// </summary>
        public virtual System.DateTime? StartDate
        {
            get;
            set;
        }

        /// <summary>
        /// Create date
        /// </summary>
        public virtual System.DateTime? FinishDate
        {
            get;
            set;
        }

        /// <summary>
        /// Create date
        /// </summary>
        public virtual System.DateTime? Target
        {
            get;
            set;
        }


        /// <summary>
        /// tag
        /// </summary>
        public virtual System.String Card
        {
            get;
            set;
        }

        /// <summary>
        /// Full size
        /// </summary>
        public virtual System.String Observations
        {
            get;
            set;
        }

        private ISet<Actual> _actuals = new HashedSet<Actual>();

        public virtual ReadOnlyCollection<Actual> Actuals
        {
            get { return new List<Actual>(_actuals).AsReadOnly(); }
        }

        public virtual void AddActual(Actual actual)
        {
            actual.TaskID = this.TaskID.ToString();
            _actuals.Add(actual);
        }

        public virtual void RemoveActual(Actual n)
        {

        }
    }
}
